package com.sky.mapper;

import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Select;

public interface OrdersMapper {

    /**
     * 插入订单
     * @param orders
     */
    // @Options(useGeneratedKeys = true, keyProperty = "id")
    // @Insert("insert into orders values (#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{},#{})")
    void insert(Orders orders);


    /**
     * 根据订单号和用户id查询订单
     * @param orderNumber
     * @param userId
     */
    @Select("select * from orders where number = #{orderNumber} and user_id= #{userId}")
    Orders getByNumberAndUserId(String orderNumber, Long userId);

    /**
     * 修改订单信息
     * @param orders
     */
    void update(Orders orders);


}
